#pragma once

#include "ros/ros.h"
#include "pix_control/pix_auto_control.h"

#include <sys/socket.h>

#include <linux/can.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <linux/can/raw.h>
#include <iostream>
#include <boost/bind.hpp>
#include <boost/thread.hpp>

namespace pix {
class Control
{
public:
    Control();
    ~Control();
    void run();
    int send_init(int id);
private:
    ros::NodeHandle nh_;

    
    int dev_handler_;
    can_frame send_frames_[5];
    can_frame recv_frames_[5];
    boost::mutex cmd_mutex_;
    
    unsigned char sendData_u_[8] = {0};

    ros::Subscriber  pix_auto_control_sub_; 
    void ctrl_callback(const pix_control::pix_auto_control msg);

    void recvDate(); // 预留接口
};
}